package com.sy.controller;

import com.sy.constant.BusinessConstant;
import com.sy.dto.JsonResult;
import com.sy.sevice.AnnouncementService;
import com.sy.vo.AnnouncementInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Yasuda-T
 * @version 1.0
 * @date 2020/9/14 17:09
 * @usage
 */
@RestController
@RequestMapping("announcements")
public class AnnouncementController {
    @Autowired
    private AnnouncementService announcementService;

    @RequestMapping(value = "",method = RequestMethod.DELETE)
    public JsonResult delNotice(Integer id, Integer state) {
        return JsonResult.buildSuccess(200,announcementService.delNotice(10, BusinessConstant.STATE_DELETE));
    }

    @RequestMapping(value = "",method = RequestMethod.POST)
    public JsonResult changeNoticeInfo(@RequestBody AnnouncementInfoVo avo, Integer id, Integer teacherId){

        return JsonResult.buildSuccess(200,announcementService.changeNoticeInfo(avo,11,2));
    }
}
